package com.etc.admin.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.etc.admin.dao.OrderViewMapper;
import com.etc.admin.service.OrderViewService;
import com.etc.entity.OrderView;
import com.etc.util.PageData;
@Service("OrderViewService")
public class OrderViewServiceImpl implements OrderViewService{
	@Resource
  private OrderViewMapper ovm;
	/**
	 * 订单分页
	 */
	@Override
	public PageData<OrderView> getOrderByPage(int page, int pageSize, String content) {
		int start=(page-1)*pageSize;
		List<OrderView> data=ovm.getOrderByPage(start, pageSize, content);
		int count=ovm.getTotal(content);
		PageData<OrderView> pd=new PageData<>(data, count, pageSize, page);
		System.out.println(pd);
		return pd;
	}
	/**
	 * 通过id查找到信息
	 */
	@Override
	public OrderView getOrderViewById(int orderid) {
		// TODO Auto-generated method stub
		return ovm.selectByPrimaryKey(orderid);
	}

}
